#!/bin/bash
function directory_hardlink {
	if [ $# -ne 2 ]
	then
		echo "error!usage:$0 $SRC_DIR $DST_DIR"
	else
		if [ -d $1 ] && [ -d $2 ]
		then
			for file in `ls $1`
			do
				if [ -d $1"/"$file ]
				then
					mkdir -p $2"/"$1"/"$file
					directory_hardlink $1"/"$file $2"/"$1
				else
					ln $file $2"/"$1"/"$file
				fi
			done
		else
			echo "ERROR!your destination documents of $1 or $2 is not a Directory"
		fi
	fi
}

directory_hardlink $1 $2
